#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h> 
#include <errno.h>
#include <unistd.h>

int main(int argc, char const *argv[])
{
    int fd;
    char buffer[64] = {0};
    int rbytes;
   
    if (argc != 2) {
        fprintf(stderr, "Usage: %s <file>\n", argv[0]);
        return -1;
    }
    fd = open(argv[1], O_RDONLY);
    if (fd == -1) {
        perror("open() falied");
        return -1;
    }
    rbytes = read(fd, buffer, 10);
    if (rbytes == -1){
        perror("Read(): ");
        return -1;
    }
    printf("Buffer : %s\n",buffer);
    close(fd);
    return 0;
}
